<?php
	session_start();
	if(!isset($_SESSION["jara_admin"])) {
		header("Location: ../login.php");
		exit;
	}
	if($_SESSION["jara_permissions"][0] == 0) {	
		header("Location: error.php");
		exit;
	}
	require_once("../include/templating_fns.php");
	require_once("../include/db_fns.php");
	
	@jara_db_query("delete from jara_comments where id = '".$_REQUEST["id"]."'");
	
	if(!isset($_REQUEST["in_cp"])) {
		header("Location: ../view.php?id=".$_REQUEST["postid"]);
	}
	else {
		header("Location: comments.php");
	}
?>